﻿<%template _header%>
<%namespace YouHP.Model%>
<div class="layout-cols2" style="width:100%;">
    <div class="col1">
        <div class="box">
            <div class="content">

            <%if ErrorCount==0%>
            <%if IsPost%>
                <div class="box">
                    <div class="caption">
                        恭喜您，你的个人信息和联系方式已经成功保存！系统默认进入疾病记录添加页面
                    </div>  
                    <div class="content">
		                <div class="navforumtrue">{MsgboxText}
			                <%if {MsgboxUrl}!=""%>
				                <p class="errorback">
					                <a href="{MsgboxUrl}">如果浏览器没有转向, 请点击这里.</a>
				                </p>
			                <%/if%>
	                    </div>
                    </div>
                </div>
            <!--<%template _msgbox%>-->
            <%else%>
                <form action="" method="post" ID="Form1">
                
                    <div class="caption"  style="width:100%;">用户信息</div>
                    
                    <table  class="table-box" style="width:95%">
                        <tr>
                            <td width ="150">
                                <label for="username">用户:</label>
                            </td>
                            <td>
                                <label id="userName">{_User.UserName}</label>
                                <span id="spanUserName"></span>
                            </td> 
                        </tr>
                        <tr>
                            <td>
                                <label for="Sex">性别:</label>
                            </td>
                            <td>
                                <input type="radio" name="Sex" value="男" checked="checked"  class="radioinput" <%if {_User.Gender}=="男"%> checked="checked" <%/if%> ID="Radio1"/>
                                男
                                <input type="radio" name="Sex" value="女"  class="radioinput" <%if {_User.Gender}=="女"%> checked="checked" <%/if%> ID="Radio2"/>
                                女
                                <span id="spanGender"></span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="bday">生日:</label>
                            </td>
                            <td>
                                <%template _DateDropdownlist%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="interest">兴趣爱好:</label>
                            </td>
                            <td style ="padding-bottom:2px;">
                                <textarea name="interest" cols="15" rows="3" id="interest" class="colorblue" onfocus="this.className='colorfocus';ShowHobbyRemindMessage();" onblur="this.className='colorblue';ValidateHobby();" style="width:80%;">{_User.Interests}</textarea>
                                <br />
                                <span id="spanHobby"> </span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="description">个人简介:</label>
                            </td>
                            <td style ="padding-bottom:2px;">
                                <textarea name="description" cols="15" rows="3" id="description" class="colorblue" onfocus="this.className='colorfocus';ShowDescriptionRemindMessage();" onblur="this.className='colorblue';ValidateDescription();" style="width:80%;">{_User.Description}</textarea>
                                <br />
                                <span id="spanDescription"> </span>
                            </td>
                        </tr>
                        <tr></tr>
                    </table>
                    
                    <div class="caption" style="width:100%;">联系方式</div>
                    
                    <table class ="table-box" style="width:95%">
                        <tr>
                            <td  width ="150">
                                <label for="email">Email:</label>
                            </td>
                            <td>
                                <input type="text" id="email" value="{_User.Email}" size="30" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" /> 
                                <span id="spanEmail"></span>
                            </td>
                        </tr>
                        <tr>
                            <td  width ="150">
                                <label for="msn">MSN:</label>
                            </td>
                            <td>
                                <input type="text" name="msn" id="msn" value="{_User.MSN}" size="30" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" /> 
                                <span id="spanMSN"></span>
                            </td>
                        </tr>
                        <tr>
                            <td  width ="150">
                                <label for="qq">QQ:</label>
                            </td>
                            <td>
                                <input type="text" name="qq" id="qq" value="{_User.QQ}" size="30" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" /> 
                                <span id="spanQQ"></span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="location">地址:</label>
                            </td>
                            <td>
                                <div>
                                    <%template _district%> 
                                    <span style ="line-height:25px"><font color='#009900'>&nbsp;填上此项有利于寻找和你一个地方的病友</font></span>
                                    <span id="spanAddress"></span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="location">详细地址:</label>
                            </td>
                            <td>
                                <input name="address" type="text" id="address" 
                                class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" 
                                value="{_User.Address}" size="30" />&nbsp;<span>(填上此项有助于我们联系您，我们将为您保密)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="zip">邮政编码:</label>
                            </td>
                            <td>
                                <input name="zip" type="text" id="location" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';ValidateZipCode();" value="{_User.ZipCode}" size="30" />
                                <span id="spanZipCode"></span><span>(填上此项有助于我们联系您，我们将为您保密)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="mobile">移动电话号码:</label>
                            </td>
                            <td>
                                <input name="mobile" type="text" id="mobile" value="{_User.MobilePhone}" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" size="30" />
                                <span id="spanMobile"></span><span>(填上此项有助于我们联系您，我们将为您保密)</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="phone">固定电话号码:</label>
                            </td>
                            <td>
                                <input name="phone" type="text" id="phone" value="{_User.Telephone}" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" size="30" />
                                <span id="spanPhone"></span><span>(填上此项有助于我们联系您，我们将为您保密)</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan ="2" align ="right">
                                <input type="submit" name="Submit" value="保存" class="buttonstyle" onclick="if (document.getElementById('description').value.length > 500) {alert('自我介绍长度最大为500字'); return false;}" ID="Submit2"/>
                            </td>
                        </tr>
                    </table>
                </form>
                <script type="text/javascript">

                    var hobbyOK = false;
                    var descriptionOK = false;

                    var zipCodeOK = false;
                    var mobileOK = true;
                    var phoneOK = true;
                  
                    function HiddenRemindMessage(tagName)
                    {                        
                        document.getElementById(tagName).innerHTML = "";
                    }
                    function ShowHobbyRemindMessage()
                    {
                        if (document.getElementById("interest").value.length == 0)
                        {
                            document.getElementById("spanHobby").innerHTML = "<font color='#009900'>兴趣爱好字符不超过50个字符</font>";
                        }
                    }
                    function ShowDescriptionRemindMessage()
                    {
                        if (document.getElementById("description").value.length == 0)
                        {
                            document.getElementById("spanDescription").innerHTML = "<font color='#009900'>自我介绍字符不超过500个字符</font>";
                        }
                    }
                    function ValidateHobby()
                    {
                        if (document.getElementById("interest").value.length > 50)
                        {
                            document.getElementById("spanHobby").innerHTML = "<font color='#009900'>兴趣爱好字符不能超过50个字符</font>";
                            hobbyOK = false;
                        }
                        else
                        {
                            document.getElementById("spanHobby").innerHTML = "";
                            hobbyOK = true;
                        }
                    }
                    function ValidateDescription()
                    {
                        if (document.getElementById("description").value.length > 500)
                        {
                            document.getElementById("spanDescription").innerHTML = "<font color='#009900'>自我介绍字符不能超过500个字符</font>";
                            descriptionOK = false;
                        }
                        else
                        {
                            document.getElementById("spanDescription").innerHTML = "";
                            descriptionOK = true;
                        }
                    }
                    function ValidateZipCode()
                    {
                        if (document.getElementById("location").value.length != 6 && document.getElementById("location").value.length != 0)
                        {
                            document.getElementById("spanZipCode").innerHTML = "<font color='#009900'>邮编号码应该为6位</font>";
                            zipCodeOK = false;
                        }
                        else
                        {
                            document.getElementById("spanZipCode").innerHTML = "";
                            zipCodeOK = true;
                        }
                    }
                    function ValidateMobile()
                    {
                        if (document.getElementById("mobile").value.length != 11 && document.getElementById("mobile").value.length != 0) 

                        {
                            document.getElementById("spanMobile").innerHTML = "<font color='#009900'>手机号码应该为11位</font>";
                            mobileOK = false;                        
                        }
                        else
                        {
                            document.getElementById("spanMobile").innerHTML = "";
                            mobileOK = true;
                        }
                    }
                    function ValidatePhone()
                    {
                    }
                </script>
            <%/if%>

    </div>

        <%else%>

        <%template _memerrmsgbox%>

        <%/if%>

        </div>
    </div>
    <div class="col2">
    <div class="col2">
        <div class="box">
        <div class="caption">填写用户信息</div>
            &nbsp;&nbsp;&nbsp;&nbsp;
            个人信息的完善对您来说至关重要。您所填写的信息越具体，越详细，我们就能为您找到越和您病情相近的患者，包括距离您最近的患者，为您们的交流奠定坚实的基础。
        </div>
    </div>
</div>
<%template _footer%>